﻿(function () {
	var prePath = "../";
	var mainPage = ["/art.html", "/folder.html", "/msg.html", "/set.html", "/login.html", "/index.html"];
	for (var i = 0; i < mainPage.length; i++) {
		if (location.href.indexOf(mainPage[i]) >= 0) {
			prePath = "";
			break;
		}
	}

	document.write('<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no" />');
	document.write('<link href="' + prePath + 'css/style.css" rel="stylesheet" />');
	document.write('<script src="' + prePath + 'js/Util.js"></script>');
	document.write('<script src="' + prePath + 'js/angular1.2.12.min.js"></script>');
	document.write('<script src="' + prePath + 'js/angular-sanitize.min.js"></script>');
	document.write('<script src="' + prePath + 'js/angular-touch.min.js"></script>');
	document.write('<script src="' + prePath + 'js/jquery.2.0.min.js"></script>');

	if ("ontouchstart" in window) {
	    document.write('<link href="' + prePath + 'css/style_phone.css" rel="stylesheet" />');
	    if (!!navigator.userAgent.match(/(i[^;]+\;(U;)? CPU.+Mac OS X)/)) {
	        // ios
	        //document.write('<script src="' + prePath + 'js/ios/cordova-2.3.0.js"></script>');
	        document.write('<script src="' + prePath + 'js/ios/CommonUtil.js"></script>');
	    }
	    else if (navigator.userAgent.indexOf('Android') > -1 || navigator.userAgent.indexOf('Linux') > -1) {
            // android
	    	document.write('<script src="' + prePath + 'js/android/CommonUtil.js"></script>');
	    }
	} else {
	    document.write('<link href="' + prePath + 'css/style_pc.css" rel="stylesheet" />');
	}
})();
